package com.gouda.core.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by KGL on 15/12/5.
 */
public enum EnumRegisterStep {
    FILL_ADMIN(1, "商户用户修改密码页"),
    FILL_MERCHANT_INFO(2, "商户信息完善页"),
    FILL_MERCHANT_BANK_INFO(3, "商户完善银行信息页"),
    MERCHANT_AUDITING(4, "商户审核页"),
    SUCCESS_LOGIN(5, "审核通过");

    private int code;
    private String msg;

    private EnumRegisterStep(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private static final Map<Integer, EnumRegisterStep> interToEnum = new HashMap<Integer, EnumRegisterStep>();

    static {
        for (EnumRegisterStep type : EnumRegisterStep.values()) {
            interToEnum.put(type.getCode(), type);
        }
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static EnumRegisterStep fromInteger(int code) {
        return interToEnum.get(code);
    }
}
